﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace TCS.Web
{
    public partial class Show : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                if ((Request.Params["id"] != null) && (Request.Params["id"].ToString() != ""))
                {
                    BindLeft();
                    string id = Request.Params["id"];
                    ShowNews(int.Parse(id));
                }
            }
        }
        private void ShowNews(int NewsId)//显示新闻
        {
            TCS.BLL.NewsManage.News bll = new TCS.BLL.NewsManage.News();
            TCS.Model.NewsManage.News model = bll.GetModelByCache(NewsId);

            ltrTitle.Text = model.Heading;
            ltrDate.Text = model.IssueDate.ToString();
            ltrContent.Text = model.Content;
            ltrFrequency.Text = model.Frequency.ToString();

            new TCS.BLL.NewsManage.News().UpFrequency(NewsId);
        }
        void BindLeft()
        {
            DataSet ds = new TCS.BLL.Products.Product().GetImgListByCategoryID(10, "");
            this.rptImgList.DataSource = ds;
            this.rptImgList.DataBind();

            DataSet dsNews = new TCS.BLL.NewsManage.News().GetNewsTopList(8, -1);
            this.rptHotList_Left.DataSource = dsNews;
            this.rptHotList_Left.DataBind();
        }
    }
}
